import request from '@/axios'
import { OrderType } from './types'

export const getOrderListApi = (params: any) => {
  return request.get<OrderType[]>({ url: '/check/order', params })
}

export const addOrderApi = (data: any) => {
  return request.post({ url: '/check/order', data })
}

export const putOrderApi = (data: any) => {
  return request.put({ url: `/check/order/${data.id}`, data })
}

export const putOrderStatusApi = (data: any) => {
  return request.put({ url: `/check/order/${data.id}/status`, data })
}

export const putOrderStampApi = (id: any, data: any) => {
  return request.put({ url: `/check/order/${id}/stamp`, data })
}

export const getOrderApi = (data: any) => {
  return request.get({ url: `/check/order/${data.id}` })
}

export const deleteOrderApi = (ids: string[] | number[]) => {
  return request.delete({ url: '/check/order', data: ids })
}

export const addOrderProgressApi = (data: any) => {
  return request.post({ url: '/check/order/progress', data })
}

export const addOrderContentApi = (data: any) => {
  return request.post({ url: '/check/order/content', data })
}

export const deleteOrderContentApi = (order_id: string | number, ids: string[] | number[]) => {
  return request.delete({ url: `/check/order/${order_id}/content`, data: ids })
}
